package com.yf.ref;

public class StrongReferenceTest {
    public static void main(String[] args) {
        StringBuffer s1 = new StringBuffer("hello, world");
        StringBuffer s2 = s1;

        s1 = null;
        System.gc();

        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        System.out.println(s2);
    }
}
